This is the replication file for Evans, King, Schwenzfeier and Thakurta (2022) 'Statistically Valid Inferences from Privacy Protected Data'. 

- To produce Fig 2, compile the `fig2.tex' file

- To replicate the remaining results in the paper, execute the script `run_all.R`. This script will install (if necessary) and load the required packages. 

- `run_all.R` takes under an hour to run on an M1 Mac OS laptop with 8gb of RAM.

- The following packages will be installed (if not already) and loaded: 
 
	'ggplot2', 'dplyr', 'latex2exp', 'ggpubr',  'stats', 'leqslv', 'VGAM', 'MASS', 'parallel', 'plm', 'lqmm', 'tidyverse', 'readstata13'

- Below we describe the scripts that `run_all.R` calls in more detail:

1. `functions.R` contains the main functions to implement our algorithm
2. `utils.R` contains functions to generate simulation data and the function we use to run simulations
3. `fig3_fig4.R` generates Fig 3 & 4 from the paper
4. `homeowner_comment.R` generates figures associated with the Yoder (2020) application
5. `bureacrat_aaa.R` generates figures associated with the Bhavani and Lee (2019) application
6. `` generates Table 2 and Fig 4
7. `simulations.R` generates Appendix Fig 2
8. `smith_simulations.R` runs the simulations comparing our algorithm to Smith (2011) and generates Appendix Fig 1
